import { lazy, Suspense } from "react";
import { CircleLoading } from "@/components/loading";

interface DynamicLoaderProps {
  componentPath: string;
}

export const DynamicLoader = ({ componentPath }: DynamicLoaderProps) => {
  const DynamicComponent = lazy(() => import("@/components/dynamic-component"));
  
  return (
    <Suspense fallback={<CircleLoading />}>
      <DynamicComponent path={componentPath} />
    </Suspense>
  );
};
